<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>商品查看</title>
<link href="<%=basePath%>skin/css/validform/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=basePath%>skin/js/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/validform/Validform_v5.3.2_min.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/editor/kindeditor.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/jquery.tools.js"></script>
<script type="text/javascript" src="<%=basePath%>skin/js/common.js"></script>
</head>

<body>
		<ul id="tab" class="tab">
			<li><input type="button" value="基础信息" /></li>
			<li><input type="button" value="商品介绍" /></li>
			<li><input type="button" value="商品图片" /></li>
			<!-- 
			<li><input type="button" value="商品参数" /></li>
			<li><input type="button" value="商品属性" /></li>
			<li><input type="button" value="商品规格" /></li> 
			-->
		</ul>
		<table width="98%" class="input tabContent">
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">商品分类：</td>
				<td class="tdLeft">
					${product.productCategory.name }
				</td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">编号：</td>
				<td class="tdLeft">${product.sn }</td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">名称：</td>
				<td class="tdLeft">${product.name }</td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">描述：</td>
				<td class="tdLeft">${product.description }</td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">销售价：</td>
				<td class="tdLeft"><fmt:formatNumber value="${product.price }" pattern="0.00"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">成本价：</td>
				<td class="tdLeft"><fmt:formatNumber value="${product.cost }" pattern="0.00"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">市场价：</td>
				<td class="tdLeft"><fmt:formatNumber value="${product.marketPrice }" pattern="0.00"/></td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">重量：</td>
				<td  class="tdLeft">${product.weight }</td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">库存：</td>
				<td class="tdLeft">${product.stock }</td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">所有重量商品编号：</td>
				<td class="tdLeft">${product.allWeightSn } </td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">推荐配件商品编号：</td>
				<td class="tdLeft">${product.recommendPartsSn }</td>
			</tr>
			<tr bgcolor="#FAFAF1" height="22">
				<td class="tdRight">推荐组合商品编号：</td>
				<td class="tdLeft">${product.recommendGroupSn } </td>
			</tr>
		</table>
		<table width="98%" class="input tabContent">
			<tr bgcolor="#EEF4EA">
				<td class="tdRight">介绍：</td>
				<td class="tdLeft">${product.introduction }</td>
			</tr>
		</table>
		<table id="productImageTable" width="98%" class="input tabContent">
			<tr class="title">
				<td>
					图片
				</td>
				<td>
					标题
				</td>
				<td>
					顺序
				</td>
			</tr>
			<c:forEach items="${product.productImages }" var="productImage">
				<tr>
					<td>
						<c:if test="${not empty productImage.source}">
							<img src="<%=basePath%>download.shtml?filepath=${productImage.source}" width="80" height="50" title="${product.name }"/>
						</c:if>
					</td>
					<td>${productImage.title }</td>
					<td>${productImage.orders }</td>
				</tr>
			</c:forEach>
		</table>
		<!-- 
		<table width="98%" class="input tabContent">
			<tr bgcolor="#EEF4EA">
			</tr>
		</table>
		<table width="98%" class="input tabContent">
			<tr bgcolor="#EEF4EA">
			</tr>
		</table>
		<table width="98%" class="input tabContent">
			<tr bgcolor="#EEF4EA">
			</tr>
		</table> 
		-->
		<table width="98%">
			<tr bgcolor="#EEF4EA">
				<td height="36" colspan="10">
					<input type="button" value="返回" class="button" onclick="location.href='<%=basePath%>admin/product/list.shtml'" />
				</td>
			</tr>
		</table>
</body>
</html>
